package com.weimob.xh.consumer;

import com.weimob.xh.config.RabbitmqConfig;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @program: xh-learn-record
 * @description:
 * @author: sch
 * @create: 2022-12-14 00:39
 **/
@Component
@RabbitListener(queuesToDeclare = @Queue(RabbitmqConfig.RABBITMQ_TOPIC_NAME))
public class RabbitMqConsumer {

    @RabbitHandler
    public void process(Map map){
        System.out.println("rabbitmq 消费消息："+map.toString());
    }

}
